<template>
    <div>
        <h1>这里是我的主入口文件</h1>
        <h3>当前计时为<i class="warning">{{seconds}}</i>秒</h3>
        <el-button @click="doLoading()" type="primary" :loading="isLoading">按钮</el-button>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                isLoading:false,
                seconds:0
            }
        },
        methods:{
            doLoading:function(){
                this.seconds = 0 
                this.isLoading = true 
                var i = setInterval(function(){
                    this.seconds += 1
                    if(this.seconds == 5){
                        this.isLoading = false
                        clearInterval(i) 
                    }
                }.bind(this),1000)
            }
        }
    }

</script>
<style>

</style>